class CreatePeoples < ActiveRecord::Migration
  def self.up
    create_table :peoples do |t|
      t.string :name, :null => false
      t.string :address, :null => false
      t.string :contact, :null => false
      t.integer :partner_id, :null => false
      t.timestamps
    end
    # add relationships here
    execute "ALTER TABLE peoples ADD FOREIGN KEY (partner_id) REFERENCES partners(id)"
  end

  def self.down
    drop_table :peoples
  end
end
